using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace InputProductForm
{
    
    class TCat
    {
        UTLDB.UTLDB _cn = new UTLDB.UTLDB();
        public DataTable GetCat(int idType)
        {
            DataTable data = new DataTable();
            data = _cn.GetDataByStoredProcedure("sp_SelecttbCatalog_idtype",
                new string[] {"@IDType"},
                new object[] {idType});
            return data;
        }
        public int Insert(Info.InfoCat info)
        {

            int id = _cn.ExecuteInsert("sp_InserttbCatalog",
               new string[] {"@Name", "@IDType","@Symbol","@Active" },
               new object[] { info.Name, info.IDType, info.Symbol, info.Active });
            return id;
        }
        public void Update(Info.InfoCat info)
        {
            int id = _cn.ExecuteNonQuery("sp_UpdatetbCatalog",
                  new string[] { "@ID", "@Name", "@IDType", "@Symbol", "@Active" },
                  new object[] {info.ID, info.Name, info.IDType, info.Symbol, info.Active });

        } 

    }
}
